<template>
  <el-card>
    <BreadCrumb />
    <el-tree :data="rightList" :props="defaultProps" accordion />
  </el-card>
</template>

<script>
import BreadCrumb from '@/components/BreadCrumb'
import { getRightList } from '@/api/rightApi'
export default {
  components: {
    BreadCrumb
  },
  data() {
    return {
      // 权限列表数据
      rightList: [],
      // 树形控件配置
      defaultProps: {
        children: 'children',
        label: 'rightName'
      }
    }
  },
  created() {
    // 获取权限数据
    this.getRightList()
  },
  methods: {
    // 获取权限列表数据
    async getRightList() {
      const { data: res } = await getRightList()
      this.rightList = res.NestedList
    }
  }
}
</script>

<style scoped>
.el-card{
  min-height:95%;
}
.el-tree /deep/ .el-tree-node__content{
  height: 50px;
}
.el-tree /deep/ .el-tree-node__label{
  font-size: 18px;
}
</style>
